/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package economicocontrol.dao.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author iMac
 */
@Entity
@Table(name = "status_personal")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusPersonal.findAll", query = "SELECT s FROM StatusPersonal s"),
    @NamedQuery(name = "StatusPersonal.findByIdStatusPer", query = "SELECT s FROM StatusPersonal s WHERE s.idStatusPer = :idStatusPer"),
    @NamedQuery(name = "StatusPersonal.findByEstadoPers", query = "SELECT s FROM StatusPersonal s WHERE s.estadoPers = :estadoPers"),
    @NamedQuery(name = "StatusPersonal.findByDescripcionStatus", query = "SELECT s FROM StatusPersonal s WHERE s.descripcionStatus = :descripcionStatus")})
public class StatusPersonal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idStatusPer")
    private Integer idStatusPer;
    @Basic(optional = false)
    @Column(name = "Estado_Pers")
    private String estadoPers;
    @Column(name = "Descripcion_Status")
    private String descripcionStatus;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "statusPersonalidStatusPer")
    private Collection<RegistroPersonal> registroPersonalCollection;

    public StatusPersonal() {
    }

    public StatusPersonal(Integer idStatusPer) {
        this.idStatusPer = idStatusPer;
    }

    public StatusPersonal(Integer idStatusPer, String estadoPers) {
        this.idStatusPer = idStatusPer;
        this.estadoPers = estadoPers;
    }

    public Integer getIdStatusPer() {
        return idStatusPer;
    }

    public void setIdStatusPer(Integer idStatusPer) {
        this.idStatusPer = idStatusPer;
    }

    public String getEstadoPers() {
        return estadoPers;
    }

    public void setEstadoPers(String estadoPers) {
        this.estadoPers = estadoPers;
    }

    public String getDescripcionStatus() {
        return descripcionStatus;
    }

    public void setDescripcionStatus(String descripcionStatus) {
        this.descripcionStatus = descripcionStatus;
    }

    @XmlTransient
    public Collection<RegistroPersonal> getRegistroPersonalCollection() {
        return registroPersonalCollection;
    }

    public void setRegistroPersonalCollection(Collection<RegistroPersonal> registroPersonalCollection) {
        this.registroPersonalCollection = registroPersonalCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idStatusPer != null ? idStatusPer.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusPersonal)) {
            return false;
        }
        StatusPersonal other = (StatusPersonal) object;
        if ((this.idStatusPer == null && other.idStatusPer != null) || (this.idStatusPer != null && !this.idStatusPer.equals(other.idStatusPer))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "economicocontrol.dao.entity.StatusPersonal[ idStatusPer=" + idStatusPer + " ]";
    }
    
}
